home *** CD-ROM | disk | FTP | other *** search
/ APC & TCP 4 / APC & TCP 4.iso / games / publicdomain / a / asteroids2 / rotx / h / rot.h < prev    next >
C/C++ Source or Header  |  1995-07-20  |  5KB  |  386 lines

  1. #define abs(x) ((x)<0?-(x):(x))
  2. #define sign(x) ((x)<0?-(1):(1))
  3.  
  4. #define LAST 2
  5.  
  6. #define LEFT 1
  7. #define RIGHT 2
  8.  
  9. #define L   0x31
  10. #define Lup 0xb1
  11. #define R   0x32
  12. #define Rup 0xb2
  13.  
  14. #define T   0x38
  15. #define Tup 0xb8
  16.  
  17. #define F   0x39
  18. #define P   0x3a
  19.  
  20. #define SPACE 0x40
  21. #define ESC 0x45
  22. #define RET 0x44
  23.  
  24. #define M   0x37
  25.  
  26.  
  27. #define F1 0x50
  28. #define F2 0x51
  29. #define F3 0x52
  30. #define F4 0x53
  31. #define F5 0x54
  32. #define F6 0x55
  33. #define F7 0x56
  34. #define F8 0x57
  35. #define F9 0x58
  36. #define F10 0x59
  37.  
  38. #define SEEKING 0
  39. #define DIRECT 1
  40. #define BARRAGE 2
  41.  
  42. typedef struct imagelocation
  43. {
  44.  UWORD player,player2;
  45.  UWORD photon;
  46.  UWORD explosion;
  47.  UWORD shield;
  48.  UWORD asteroid[3];
  49.  UWORD box,line,diamond,mine;
  50.  UWORD asaucer,saucer;
  51.  UWORD battleship;
  52.  UWORD elight;
  53.  UWORD eheavy;
  54.  UWORD xcruiser;
  55.  UWORD fighter;
  56.  UWORD triangle;
  57.  UWORD debris;
  58.  UWORD minelayer;
  59.  UWORD dreadnought;
  60.  UWORD magnetic;
  61.  UWORD expander;
  62.  UWORD displacer;
  63.  UWORD sauphot;
  64.  UWORD dreadshield;
  65.  UWORD rectangle;
  66.  UWORD carrier;
  67.  UWORD hold2;
  68.  UWORD hold3;
  69.  UWORD hold4;
  70. };
  71.  
  72.     
  73. typedef struct gameinput
  74. {
  75.  BOOL LT[3],RT[3];
  76.  BOOL FI[3],FIUP[3],HY[3];
  77.  BOOL TH[3],THUP[3];
  78.  BOOL PAUSE,EXIT,KEY,NEXT;
  79. };
  80.  
  81.  
  82. typedef struct gameinfo
  83. {
  84.  WORD he,wi,de;
  85.  WORD x1,y1;
  86.  WORD x2,y2;
  87.  WORD dx,dy;
  88.  WORD processor;
  89.  WORD largefontheight;
  90.  WORD mediumfontheight;
  91.  WORD smallfontheight;
  92. ULONG screentype;
  93. };
  94.  
  95. typedef struct shotI
  96. {
  97.  BOOL flight;
  98.  WORD vx,vy;
  99.  WORD xp,yp;
  100.  WORD dx,dy;
  101.  WORD oxp,oyp;
  102.  WORD opos;
  103.  WORD pos;
  104.  WORD len;
  105.  WORD range;
  106. };
  107.  
  108. typedef struct photI
  109. {
  110.  BOOL flight;
  111.  WORD vx,vy;
  112.  WORD xp,yp;
  113.  WORD oxp,oyp;
  114.  BYTE pos,rot;
  115.  WORD range;
  116.  BYTE turn;
  117.  WORD delay;
  118.  BYTE type;
  119.  BYTE wrap;
  120.  WORD image;
  121. };
  122.  
  123. typedef struct highscorelist
  124. {
  125.  UBYTE name[30];
  126.  LONG score,level;
  127. };
  128.  
  129.  
  130. #define HUMAN 0
  131. #define COMPUTER 1
  132. #define DESTROYED 2
  133.  
  134.  
  135. typedef struct box
  136. {
  137. WORD x,y;
  138. WORD ox,oy;
  139. WORD pos;
  140. WORD length;
  141. WORD type;
  142. WORD image;
  143. BYTE rots;
  144. };
  145.  
  146. typedef struct explosion
  147. {
  148. WORD x,y;
  149. BYTE frame,length;
  150. BOOL flag;
  151. };
  152.  
  153. typedef struct asteroid
  154. {
  155.  WORD x,y;
  156.  WORD ox,oy;
  157.  WORD vx,vy;
  158.  BYTE rot,dir;
  159.  WORD size;
  160.  WORD flag;
  161. };
  162.  
  163. typedef struct saucer
  164. {
  165. WORD x,y;
  166. WORD ox,oy;
  167. WORD vx,vy;
  168. WORD flag;
  169. BYTE rot;
  170. BYTE delay;
  171. BYTE fnum;
  172. BYTE type;
  173. BOOL haltfire;
  174. UBYTE image;
  175. struct photI photI[20];
  176. };
  177.  
  178. typedef struct fighter
  179. {
  180.  WORD x,y,pos;
  181.  WORD ox,oy;
  182.  WORD vmax;
  183.  BYTE aim;
  184.  WORD ax,ay;
  185.  WORD flight;
  186.  WORD x1,y1,x2,y2;
  187.  WORD ox1,oy1,ox2,oy2;
  188.  WORD delay,fdelay;
  189.  BOOL fire;
  190. };
  191.  
  192.  
  193. typedef struct hyper
  194. {
  195.  WORD x,y;
  196.  WORD ox,oy;
  197.  WORD destx,desty;
  198.  WORD vx,vy;
  199.  BYTE rot;
  200.  BOOL flag;
  201.  WORD image;
  202. };
  203.  
  204.  
  205. typedef struct debris
  206. {
  207.  WORD x,y;
  208.  WORD ox,oy;
  209.  WORD pos,vmax;
  210.  WORD length,vdelay;
  211.  BYTE rot;
  212.  WORD image;
  213.  WORD delay;
  214. };
  215.  
  216. typedef struct mine
  217. {
  218.  WORD x,y;
  219.  WORD ox,oy;
  220.  BYTE rot;
  221.  WORD mdelay;
  222.  WORD type;
  223.  WORD flight;
  224.  WORD x1,y1,x2,y2;
  225.  WORD ox1,oy1,ox2,oy2;
  226.  WORD delay,fdelay;
  227.  BOOL fire;
  228. };
  229.  
  230.  
  231. typedef struct battleship
  232. {
  233.  WORD x,y,pos;
  234.  WORD ox,oy;
  235.  WORD fx,fy;
  236.  WORD vx,vy;
  237.  WORD vmax,turn;
  238.  WORD man;
  239.  WORD shield;
  240.  WORD fnum,fvmax,fdam;
  241.  WORD ftype;
  242.  WORD pnum,pvmax,pdam,pman,prange,pdelay;
  243.  BYTE flight;
  244.  WORD dnum;
  245.  WORD x1[10],y1[10],x2[10],y2[10];
  246.  WORD ox1[10],oy1[10],ox2[10],oy2[10];
  247.  WORD fdelay[10];
  248.  struct shotI shotI[40];
  249.  
  250.  BOOL lbox,rbox,line;
  251.  BYTE lrot,rrot,lirot;
  252.  LONG image;
  253. };
  254.  
  255. typedef struct ship
  256. {
  257.  WORD x,y,pos;
  258.  WORD modx,mody;
  259.  WORD ox,oy;
  260.  WORD vx,vy;
  261.  WORD shield;
  262.  WORD shieldstart;
  263.  WORD vmax,turn;
  264.  WORD man;
  265.  WORD fnum,fvmax,fdam,flen,ftype,fdelay,frate;
  266.  WORD pnum,pvmax,pdam,pman,prange,pdelay,pimage,prate;
  267.  WORD blast;
  268.  BYTE aim;
  269.  LONG wait;
  270.  WORD pilot;
  271.  LONG shieldstat;
  272.  LONG pointvalue;
  273.  struct shotI shotI[40];
  274.  struct photI photI[40];
  275.  LONG image;
  276.  LONG shIno;
  277.  WORD exhlx[20],exhly[20];        /* thrust coordinates */
  278.  WORD exhrx[20],exhry[20];        /* thrust coordinates */
  279.  WORD exhd[20];
  280. };
  281.  
  282.  
  283. typedef struct control
  284. {
  285.  BYTE ship[10];
  286.  BYTE boxnum;
  287.  BYTE playernum;
  288.  BYTE enemynum;
  289.  BYTE maxenemynum;
  290.  BYTE maxplayernum;
  291.  BYTE availenemyships;
  292.  WORD asteroidnum;
  293.  BYTE explosionnum;
  294.  BYTE hypernum;
  295.  BYTE battleshipnum;
  296.  BYTE thrustlength;
  297.  BYTE player[2];
  298.  LONG score[2];
  299.  LONG lives[2];
  300.  LONG wait[2];
  301.  LONG input[2];
  302.  LONG fire[2];
  303.  LONG tech[2];
  304.  LONG shield[2];
  305.  LONG weapon[2];
  306.  LONG hyper[2];
  307.  LONG firecount[2];
  308.  LONG firedelay[2];
  309.  BYTE level;
  310.  BYTE enemyonscreen;
  311.  BOOL endgame;
  312.  LONG endgamewait;
  313.  WORD asize;
  314.  LONG delay;
  315.  BYTE playmode;
  316.  UBYTE ftrnum;
  317.  BOOL fighter;
  318.  UBYTE minenum;
  319.  UBYTE debrisnum;
  320.  BOOL mines;
  321.  BYTE game;
  322.  BYTE pause;
  323.  BYTE startlevel;
  324.  BYTE difficulty;
  325.  BYTE standarddebris;
  326.  BOOL audio;
  327.  BOOL firewrap;
  328.  BOOL autofire;
  329.  BYTE screentype;
  330.  BYTE fontsize;
  331.  WORD dlpos;
  332. };
  333.  
  334. typedef struct saveoptions
  335. {
  336. BYTE input[2];
  337. BYTE enemyonscreen;
  338. UBYTE ftrnum;
  339. LONG delay;
  340. BYTE playmode;
  341. BYTE game;
  342. BYTE startlevel;
  343. BYTE difficulty;
  344. BYTE firewrap;
  345. BYTE autofire;
  346. BYTE playernum;
  347. BYTE standarddebris;
  348. BYTE screentype;
  349. BYTE fontsize;
  350. };
  351.  
  352. typedef struct keys
  353.  WORD left,right;
  354.  WORD fire,thrust;
  355.  WORD hyperspace;
  356.  WORD pause;
  357. };
  358.  
  359. typedef struct imagedata
  360. {
  361.  WORD xc,yc;
  362.  WORD wi,he,wo;
  363.  ULONG length;
  364.  BYTE color;
  365.  UWORD mask;
  366.  UWORD *data;
  367. };
  368.  
  369. typedef struct vectordata
  370. {
  371.  WORD zero;
  372.  WORD x[30],y[30],num;
  373.  WORD pos,rots;
  374.  UWORD mask;
  375.  BYTE color;
  376. };
  377.  
  378. typedef struct drawlist
  379. {
  380.  WORD x,y;
  381.  WORD pic;
  382.  BYTE color;
  383.  UWORD mask;
  384. };
  385.